
package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type StoreCouponIssueRequest struct {

	Cid string `json:"cid" form:"cid"`

	CouponTitle string `json:"coupon_title" form:"coupon_title"`

	StartTime string `json:"start_time" form:"start_time"`

	EndTime string `json:"end_time" form:"end_time"`

	TotalCount string `json:"total_count" form:"total_count"`

	RemainCount string `json:"remain_count" form:"remain_count"`

	ReceiveLimit string `json:"receive_limit" form:"receive_limit"`

	IsPermanent string `json:"is_permanent" form:"is_permanent"`

	Status string `json:"status" form:"status"`

	IsGiveSubscribe string `json:"is_give_subscribe" form:"is_give_subscribe"`

	IsFullGive string `json:"is_full_give" form:"is_full_give"`

	FullReduction string `json:"full_reduction" form:"full_reduction"`

	IsDel string `json:"is_del" form:"is_del"`

	AddTime string `json:"add_time" form:"add_time"`

	Title string `json:"title" form:"title"`

	Integral string `json:"integral" form:"integral"`

	CouponPrice string `json:"coupon_price" form:"coupon_price"`

	UseMinPrice string `json:"use_min_price" form:"use_min_price"`

	CouponTime string `json:"coupon_time" form:"coupon_time"`

	ProductId string `json:"product_id" form:"product_id"`

	CategoryId string `json:"category_id" form:"category_id"`

	Type string `json:"type" form:"type"`

	ReceiveType string `json:"receive_type" form:"receive_type"`

	StartUseTime string `json:"start_use_time" form:"start_use_time"`

	EndUseTime string `json:"end_use_time" form:"end_use_time"`

	Sort string `json:"sort" form:"sort"`

}

func (r *StoreCouponIssueRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *StoreCouponIssueRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{

		"cid": "required",

		"coupon_title": "required",

		"start_time": "required",

		"end_time": "required",

		"total_count": "required",

		"remain_count": "required",

		"receive_limit": "required",

		"is_permanent": "required",

		"status": "required",

		"is_give_subscribe": "required",

		"is_full_give": "required",

		"full_reduction": "required",

		"is_del": "required",

		"add_time": "required",

		"title": "required",

		"integral": "required",

		"coupon_price": "required",

		"use_min_price": "required",

		"coupon_time": "required",

		"product_id": "required",

		"category_id": "required",

		"type": "required",

		"receive_type": "required",

		"start_use_time": "required",

		"end_use_time": "required",

		"sort": "required",

	}
}

func (r *StoreCouponIssueRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *StoreCouponIssueRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *StoreCouponIssueRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
